<template>
    <el-card class="box-card">
        <el-table :data="customerManagersData" style="width: 100%">
            <el-table-column prop="ID" label="ID" width="80px"></el-table-column>
            <el-table-column prop="name" label="姓名"></el-table-column>
            <el-table-column prop="code" label="工号"></el-table-column>
            <el-table-column prop="phone" label="电话号码"></el-table-column>
            <el-table-column prop="city_name" label="城市名称"></el-table-column>
            <el-table-column prop="city_code" label="城市代码"></el-table-column>
            <el-table-column width="80px">
                <template scope="scope">
                    <el-tooltip content="编辑客户经理" placement="top">
                        <el-button class="el-icon-edit" type="primary" size="small" @click="customerEdit"></el-button>
                    </el-tooltip>
                </template>
            </el-table-column>
        </el-table>
        <el-col :span="24" class="lastCol">
            <el-button type="primary" @click="addCustomer">添加客户经理</el-button>
        </el-col>
    </el-card>
</template>
<script>
    export default {
        data() {
            return {
                customerManagersData: [
                    {
                        ID: '4',
                        name: '发觉',
                        code: '999300',
                        phone: '1345678903',
                        city_name: '风好大',
                        city_code: 'taibei'
                    },
                    {
                        ID: '5',
                        name: '发觉',
                        code: '999300',
                        phone: '1345678903',
                        city_name: '风好大',
                        city_code: 'taibei'
                    }
                ]
            }
        },
        methods: {
            addCustomer(row) {
                this.$router.push(`/customer_managers/new`);
            },
            customerEdit(row) {
                this.$router.push(`/customer_managers/${row.id}/edit`);
            }
        }
    }
</script>